fix(#72): improve autoFocus handling on AddSubscriptionScreen#489
Merged
Smartdevs17 merged 2 commits intoJun 1, 2026
Merged
Conversation
autoFocus opens the keyboard immediately on mount, which can block UI elements before the screen finishes rendering. Replace it with a ref-based focus triggered after a 300 ms delay, giving the navigation transition time to complete on both iOS and Android. - Add nameInputRef (useRef<TextInput>) to the name field - Remove autoFocus prop from the name TextInput - Focus the input programmatically after 300 ms in a useEffect - Import useRef from React
…lity tracking - Switch KeyboardAvoidingView behavior to 'padding' on iOS and undefined on Android (Android handles scroll natively) - Track keyboard show/hide events with Keyboard listeners to set isKeyboardVisible state - Apply extra bottom padding to ScrollView content when keyboard is open so all form fields remain reachable - Import Keyboard from react-native
|
@senmalong Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #72
The
autoFocusprop on the subscription name input caused the keyboard to open immediately on mount, blocking UI elements before the screen finished rendering — especially noticeable during the navigation transition on Android.Changes
Commit 1 — Replace
autoFocuswith delayed focus viauseRefnameInputRef(useRef<TextInput>) to the name fieldautoFocusprop from the nameTextInputuseEffect, giving the navigation transition time to complete on both platformsuseReffrom ReactCommit 2 — Improve
KeyboardAvoidingViewand keyboard visibility trackingKeyboardAvoidingViewbehavior to'padding'on iOS andundefinedon Android (Android's scroll container handles this natively)Keyboardlisteners (keyboardWillShow/keyboardDidShowand their hide counterparts) to trackisKeyboardVisiblestateScrollViewcontent when the keyboard is open, keeping all form fields reachableKeyboardfromreact-nativeAcceptance Criteria
KeyboardAvoidingViewbehaves correctly on iOS (padding) and Android (native scroll)Testing
Tested manually on: